import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@/views/logReg/login.vue'
import reg from '@/views/logReg/reg.vue'
import home from '@/views/home.vue'
import chart from '@/views/main/chart.vue'
import userinfo from '@/views/main/UserInfo.vue'
import UserAvatar from '@/views/main/UserAvatar.vue'
import userpwd from '@/views/main/UserPwd.vue'
import ArtCate from '@/views/article/ArtCate.vue'
import ArtList from '@/views/article/ArtList.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: login },
  { path: '/reg', component: reg },
  {
    path: '/',
    component: home,
    redirect: '/home',
    children: [
      { path: 'home', component: chart },
      { path: 'user-info', component: userinfo },
      { path: 'user-avatar', component: UserAvatar },
      { path: 'user-pwd', component: userpwd },
      { path: 'art-cate', component: ArtCate },
      { path: 'art-list', component: ArtList }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
